package main 
{
	import assists.URI;
	
	import inerface.IMessage;

	/**
	 * ...
	 * @author clouree
	 */
	public class DataBase extends SuperBase
	{
		private var _xmlLoaderManager:XMLLoaderManager;
		private var _server:Server;
		private var _uri:URI;
		public function DataBase() 
		{
			super();
			
		}
		
	    public function init(xmlloader:XMLLoaderManager,uri:URI):void
		{
			_uri = uri;
			_xmlLoaderManager = xmlloader;
			_server = new Server();
		}
		
		public function get uri():URI
		{
			return _uri;
		}
		
		public function send(message:IMessage):void
		{
			_server.send(message);
		}
		
		public function registerMessageHandler(messageId:uint,callBack:Function):void
		{
			server.registerMessageHandler(messageId,callBack)
		}
		
		public function cancelMessageHandler(messageId:uint,callBack:Function):void
		{
			server.cancelMessageHandler(messageId,callBack);
		}
		
		public function get server():Server
		{
			return _server;
		}
		
		public function get xmlLoaderManager():XMLLoaderManager
		{
			return _xmlLoaderManager;
		}
	}

}